package com.atguigu.gmall.feign.search;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.search.Goods;
import com.atguigu.gmall.search.vo.SearchParamVo;
import com.atguigu.gmall.search.vo.SearchRespVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("service-search")//将要调用的微服务
@RequestMapping("/api/inner/rpc/search")//调用的地址
public interface SearchFeignClient {

    //增加热度分
    @GetMapping("/hotscore/{skuId}/{score}")
    public Result updateHotScore(@PathVariable("skuId") Long skuId,@PathVariable("score") Long score);

    //检索商品
    @PostMapping("/searchgoods")
    public Result<SearchRespVo> search(@RequestBody SearchParamVo searchParamVo);

    //商品上架
    @PostMapping("/up/goods")
    public Result onSale(@RequestBody Goods goods);

    //商品下架
    @GetMapping("/down/goods/{skuId}")
    public Result cancelSale(@PathVariable("skuId") Long skuId);
}
